package org.jmh.gift.doc;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 礼物的doc文档对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "jmh-gift",type = "gift")
public class GiftDoc {

    @Id
    private Long id; //spuid

    @Field(type = FieldType.Keyword)
    private String cover;

    @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer ="ik_smart" )
    private String name;

    @Field(type = FieldType.Long)
    private Long tenantId;

    @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer ="ik_smart")
    private String tenantName;

    @Field(type = FieldType.Long)
    private Long typeId;

    @Field(type = FieldType.Keyword)
    private String typeName;

    @Field(type = FieldType.Long)
    private Long brandId;

    @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer ="ik_smart")
    private String branName;

    @Field(type = FieldType.Integer)
    private Integer commentCount;

    @Field(type = FieldType.Integer)
    private Integer saleCount;

    @Field(type = FieldType.Double)
    private BigDecimal maxPrice;

    @Field(type = FieldType.Double)
    private BigDecimal minPrice;

    @Field(type = FieldType.Keyword)
    private String specProperties;

    @Field(type = FieldType.Keyword)
    private String skuProperties;

    @Field(type = FieldType.Date)
    private Date onsaleTime = new Date();
    @Field(type = FieldType.Date)
    private Date offsaleTime = new Date();
    @Field(type = FieldType.Keyword)
    private String brand;


}
